#include "util.h"
#include <string> 

using std::string;

int Util::countWords(const char* c_str){
	int res = 1;	
	string str(c_str);

	if(str.length() == 0 || str.compare("\\n") == 0)
		return 0;

	int found = -1;
	while((found = str.find(" ",found + 1)) != string::npos){
		++res;
	}
	return res;
}
